<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
  <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
  <link rel="stylesheet" type="text/css" href="msoffice.css" />
  <Title>Build Events</Title>
</HEAD>

<body>
  <H3>Build Events</H3>
  <div id="mybody">
    There are three build events per code file. These are pre build, custom build and post build. Pre build events are processed before the actual build commences.
    A custom build replaces the in built build (for example no compile will be done by the internal compiler). You have to make sure to create a file with the exact configured output name though to have the followup event or running the build work.
    The post build event is run after a build. The post build is a good place to add crunching to your executable. Also here, make sure to give the final file the exact configured output name.<br>
    <br>
    The build events are configured via <a href="ide_solution_explorer.html">Solution Explorer</a> in the <a href="ide_solution_explorer.html#property_buildevents">Build Events</a> property tab.<br>
    <br>
    <br>
    All the event scripts allow the use of macros to insert build specifica. A macro is inserted by adding $(Macro Name) in the script. Instead of a provided macro also labels from the code can be used. This may be useful if you want to set an address that may move when the code changes. These macros are currently supported:<br>
    <br>
    Example for a project file located at d:\projects\lsmf\lsmfmain.asm:<br>
    <table>
      <th>
        Macro
      </th>
      <th>
      Output
      </th>
      <th>
      Meaning
      </th>
      <tr>
      <td>
        <b>$(Filename)</b>
      </td>
      <td>
        d:\projects\lsmf\lsmfmain.asm
      </td>
      <td>
        Returns the fully qualified filename to the current document
      </td>
      </tr>
      <tr>
      <td>
        <b>$(FilenameWithoutExtension)</b>
      </td>
      <td>
        d:\projects\lsmf\lsmfmain
      </td>
      <td>
        Returns the fully qualified filename to the current document, minus the file's extension
      </td>
      </tr>
      <tr>
      <td>
        <b>$(FilePath)</b>
      </td>
      <td>
        d:\projects\lsmf
      </td>
      <td>
        Returns the fully qualified path to the current document
      </td>
      </tr>
      <tr>
      <td>
        <b>$(BuildTargetPath)</b>
      </td>
      <td>
        depends on the target file configuration
      </td>
      <td>
        Returns the fully qualified path to the current document if no full path is configured.
        Returns the fully qualified path to the configured build target file
      </td>
      </tr>
      <tr>
      <td>
        <b>$(BuildTargetFullPath)</b>
      </td>
      <td>
        depends on the target file configuration
      </td>
      <td>
        Returns the fully qualified filename to the configured build target file
      </td>
      </tr>
      <tr>
      <td>
        <b>$(BuildTargetFullPathWithoutExtension)</b>
      </td>
      <td>
        depends on the target file configuration
      </td>
      <td>
        Returns the fully qualified filename without extension to the configured build target file
      </td>
      </tr>
      <tr>
      <td>
        <b>$(BuildTargetFilename)</b>
      </td>
      <td>
        depends on the target file configuration
      </td>
      <td>
        Returns the target filename
      </td>
      </tr>
      <tr>
      <td>
        <b>$(BuildTargetFilenameWithoutExtension)</b>
      </td>
      <td>
        depends on the target file configuration
      </td>
      <td>
        Returns the target filename without extension
      </td>
      </tr>
      <tr>
      <td>
        <b>$(DebugStartAddress)</b>
      </td>
      <td>
        depends on the document configuration
      </td>
      <td>
        Returns the configured debug start address decimal
      </td>
      </tr>
      <tr>
      <td>
        <b>$(DebugStartAddressHex)</b>
      </td>
      <td>
        depends on the document configuration
      </td>
      <td>
        Returns the configured debug start address hexadecimal
      </td>
      </tr>
      <tr>
      <td>
        <b>$(ConfigName)</b>
      </td>
      <td>
        &nbsp;
      </td>
      <td>
        Returns the chosen configuration for the build
      </td>
      </tr>
      <tr>
        <td>
          <b>$(ProjectPath)</b>
        </td>
        <td>
          d:\projects\lsmf\
        </td>
        <td>
          Returns the base path of the project
        </td>
      </tr>
      <tr>
        <td>
          <b>$(MediaManager)</b>
        </td>
        <td>
          d:\C64Studio\MediaManager.exe
        </td>
        <td>
          Returns the full path to the <a href="media_manager.html">Media Manager</a> executable
        </td>
      </tr>
      <tr>
        <td>
          <b>$(MediaTool)</b>
        </td>
        <td>
          d:\C64Studio\MediaTool.exe
        </td>
        <td>
          A command line tool that provides several charset/spriteset modification/export/import tools, see <a href="media_tool.html">Media Tool</a>
        </td>
      </tr>
    </table>
  </div>
</body>
</HTML>
